import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/table';
import { RenderType } from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '提交日期',
    dataIndex: 'createTime',
    width: 150,
  },
  {
    title: '会员姓名',
    dataIndex: 'userName',
    width: 80,
  },
  {
    title: '会员电话',
    dataIndex: 'phone',
    width: 120,
  },
  {
    title: '会员卡号',
    dataIndex: 'vipCardNo',
    width: 150,
  },
  {
    title: '预约类型',
    dataIndex: 'appointType',
    width: 80,
    dictData: [
      { label: '贵宾厅', value: '1' },
      { label: '贵宾通道', value: '2' },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '证件类型',
    dataIndex: 'identityType',
    width: 80,
    dictData: [
      { label: '身份证', value: 1 },
      { label: '护照', value: 2 },
      { label: '港澳通行证', value: 3 },
      { label: '台胞证', value: 4 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '始发地',
    dataIndex: 'originatingPlace',
    width: 130,
  },
  {
    title: '到达地',
    dataIndex: 'destinationPlace',
    width: 130,
  },
  {
    title: '航班号',
    dataIndex: 'flightNumber',
    width: 120,
  },
  {
    title: '航班日期',
    dataIndex: 'flightDate',
    width: 100,
  },
  {
    title: '起飞时间',
    dataIndex: 'takeOffTime',
    width: 80,
  },
  {
    title: '次数',
    dataIndex: 'appointmentUseNum',
    width: 60,
  },
  {
    title: '预约状态',
    dataIndex: 'appointmentState',
    width: 100,
    align: 'center',
    dictData: [
      { label: '无需预约', value: '0' },
      { label: '等待预约', value: '1' },
      { label: '预约成功', value: '2' },
      { label: '预约失败', value: '3' },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '开卡地',
    dataIndex: 'airportName',
    width: 180,
  },
  {
    title: '支付状态',
    dataIndex: 'orderStatus',
    width: 100,
    dictData: [
      { label: '待付款', value: '1' },
      { label: '已付款', value: '2' },
      { label: '已退款', value: '3' },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '预约来源',
    dataIndex: 'sourceType',
    width: 100,
    dictData: [
      { label: '商城购买', value: '1' },
      { label: '会员权益使用', value: '2' },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '预约服务',
    dataIndex: 'targetName',
    width: 250,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'userName',
    label: '会员姓名',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'phone',
    label: '会员电话',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'appointmentState',
    label: '预约状态',
    component: 'Select',
    colProps: { span: 5 },
    componentProps: {
      options: [
        { label: '无需预约', value: '0' },
        { label: '等待预约', value: '1' },
        { label: '预约成功', value: '2' },
        { label: '预约失败', value: '3' },
      ],
    },
  },
  {
    field: 'sourceType',
    label: '预约来源',
    component: 'Select',
    colProps: { span: 5 },
    componentProps: {
      options: [
        { label: '商城购买', value: '1' },
        { label: '会员权益使用', value: '2' },
      ],
    },
  },
  {
    field: 'startDate',
    label: '开始日期',
    component: 'DatePicker',
    colProps: { span: 5 },
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
  {
    field: 'endDate',
    label: '结束日期',
    component: 'DatePicker',
    colProps: { span: 5 },
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
];

export const checkFormSchema: FormSchema[] = [
  {
    label: '预约Id',
    field: 'appointmentId',
    component: 'Input',
    required: true,
    show: false,
  },
  {
    label: '预约核验码',
    field: 'useCode',
    component: 'Input',
    required: false,
  },
  {
    label: '预约状态',
    field: 'appointmentState',
    component: 'RadioGroup',
    required: true,
    colProps: 12,
    componentProps: {
      options: [
        { label: '成功', value: 2 },
        { label: '失败', value: 3 },
      ],
    },
  },
  {
    label: '预约提醒',
    field: 'remindWay',
    component: 'RadioGroup',
    required: true,
    defaultValue: 3,
    colProps: 12,
    componentProps: {
      options: [
        { label: '短信', value: 1 },
        { label: '系统消息', value: 2 },
        { label: '全部', value: 3 },
      ],
    },
  },
];
